var express = require('express');
var AnserModel = require('../db/answerModel')

module.exports = async function (req, res) {
    const {ids} = req.body
    const arr = eval(ids)
    for (let i = 0; i < arr.length; i++) {
        await AnserModel.remove({id: arr[i]}, function (error) {
            if (error) {
                res.status(400).send({
                    status: 400,
                    message: "删除失败"
                })
            }
        })
    }
    res.send({
        status: 200,
        messgae: "删除成功"
    })
}